namespace cpp ddm.thrift
namespace cpp2 ddm.thrift

include "openr/if/Network.thrift"

exception DdmError {
  1: string message;
} (message = "message")

struct Range {
  1: i64 low;
  2: i64 high;
}

struct HeaderSpace {
  1: list<Range> ranges;
}

struct Requirement {
  1: string name;
  2: Network.IpPrefix prefix;
} (cpp.minimize_padding)

struct DDMTuple {
  1: string egress;
  2: HeaderSpace hs;
}

service DdmCtrl {
  void insertRoute(1: Network.UnicastRoute route) throws (
    1: DdmError error,
  );

  void submitRequirement(1: Requirement req) throws (
    1: DdmError error,
  ) 
}

service UDPService {
  void verify(1: string reqName, 2: list<DDMTuple> tuples) throws (
    1: DdmError error,
  )
}